import Vue from 'vue'
import VueRouter from 'vue-router'
// import classfirst from '../components/goods/classify/classfirst'
// import shopindex from '../components/goods/shop/shopindex'
import Login from '../views/login'




Vue.use(VueRouter)
//
const router = new VueRouter(
    {
  mode: 'history',
  base: process.env.BASE_URL,

  routes:[
    {
      path: '/',
      component: Login
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/index',
      // name:'index',
      meta: { requireAuth: true },
      // redirect:{path:'/showPage'},
      component: () => import('../views/index.vue'),
    },
//     //文章列表
//     {
//       path: '/articleList',
//       name: 'articleList',
//       component: () => import(/* webpackChunkName: "about" */ '../components/website/articleList.vue'),
//     },
//     {
//       path: '/updateArticle',
//       name: 'updateArticle',
//       component: () => import(/* webpackChunkName: "about" */ '../components/website/updateArticle.vue'),
//     },
//     //添加文章
//     {
//       path: '/addArticle',
//       name: 'addArticle',
//       component: () => import(/* webpackChunkName: "about" */ '../components/website/addArticle.vue')
//     },
//     //广告列表
//     {
//       path: '/advertisement',
//       name: 'advertisement',
//       component: () => import(/* webpackChunkName: "about" */ '../components/website/advertisement.vue'),
//     },
//     // 添加广告
//     {
//       path: '/addAdvertisement',
//       name: 'addAdvertisement',
//       component: () => import(/* webpackChunkName: "about" */ '../components/website/addAdvertisement.vue')
//     },
//     //菜单管理
//     {
//       path: '/Menu_management',
//       name: 'Menu_management',
//       component: () => import(/* webpackChunkName: "about" */ '../components/website/Menu_management.vue'),
//     },
//     //支付管理
//     {
//       path: '/Payment_management',
//       name: 'Payment_management',
//       component: () => import(/* webpackChunkName: "about" */ '../components/website/Payment_management.vue')
//     },
//     {
//       path: '/orderGroup',
//       name: 'orderGroup',
//       component: () => import(/* webpackChunkName: "about" */ '../views/index/order/orderGroup/orderGroup')
//     },
//     {
//       path:'/messagefirst',
//       name:'messagefirst',
//       component: () => import( '../components/goods/comment/messagefirst'),
//       children: [
//         {
//           path: '/message',
//           name: 'message',
//           component: () => import( '../components/goods/comment/message'),
//         },
//         {
//           path: '/messnone',
//           name: 'messnone',
//           component: () => import( '../components/goods/comment/messnone'),
//         },
//       ]
//     },
//     {
//       path:'/label',
//       name:'label',
//       component: () => import( '../components/goods/label/label'),
//     },
//     {
//       path:'/classfirst',
//       name:'classfirst',
//       component: classfirst,
//     },
//     {
//       path: '/shopindex',
//       name: 'shopindex',
//       component: shopindex,
//       children: [
//         {
//           path: '/goods',
//           name: 'goods',
//           component: () => import( '../components/goods/shop/goods'),
//         },
//         {
//           path: '/add',
//           name: 'add',
//           component: () => import( '../components/goods/shop/add'),
//         },
//         {
//           path: '/mix',
//           name: 'mix',
//           component: () => import( '../components/goods/shop/mix'),
//         },
//         {
//           path: '/delAll',
//           name: 'delAll',
//           component: () => import( '../components/goods/shop/delAll'),
//         }
//
//       ],
//
//     },
//     {
//       path:  '/order',
//     name: 'order',
//     component: () => import( '../components/order/order.vue')
// },
// {
//   path: '/order_details',
//       name: 'order_details',
//
//     component: () => import( '../components/order/order_details.vue')
// },
//     {
//       path: '/orderGroup',
//       name: 'orderGroup',
//
//       component: () => import( '../components/order/orderGroup/orderGroup')
//     },
// {
//   path: '/rejectOrder',
//       name: 'rejectOrder',
//
//     component: () => import( '../components/order/rejectOrder.vue')
// },
// {
//   path: '/refunddetails',
//       name: 'refunddetails',
//     component: () => import( '../components/order/refunddetails.vue')
// },
//     {
//       path: '/sendOrder',
//       name: 'sendOrder',
//       component: () => import( '../components/order/sendOrder')
//     },
//
//     {
//       path: '/accountManage',
//       name: 'accountManage',
//       component: () => import( '../components/set/accountManage')
//     },
//     {
//       path: '/roleManage',
//       name: 'roleManage',
//       component: () => import( '../components/set/roleManage')
//     },
//     {
//       path: '/logManage',
//       name: 'logManage',
//       component: () => import( '../components/set/logManage')
//     },
//     {
//       path: '/coupon',
//       name: 'coupon',
//       component: () => import(/* webpackChunkName: "about" */ '../components/promote/coupon/coupon'),
//       children:[
//         {
//           path: '/',
//           name: 'promote',
//           component: () => import(/* webpackChunkName: "about" */ '../components/promote/coupon/promote')
//         },
//         {
//           path: '/promote',
//           name: 'promote',
//           component: () => import(/* webpackChunkName: "about" */ '../components/promote/coupon/promote')
//         },
//         {
//           path: '/add',
//           name: 'add',
//           component: () => import(/* webpackChunkName: "about" */ '../components/promote/coupon/add')
//         },
//       ]
//     },
//     {
//       path: '/',
//       name: 'miaosha',
//
//       // component: () => import(/* webpackChunkName: "about" */ '../views/index/secKill.vue'),
//       component: () => import(/* webpackChunkName: "about" */ '../components/promote/seckill/miaosha'),
//       children:[
//         {
//           path: '/addSecKill',
//           name: 'addSecKill',
//           component: () => import(/* webpackChunkName: "about" */ '../components/promote/seckill/addSecKill')
//         },
//       ]
//     },
//     {
//       path: '/help',
//       name: 'help',
//       // component: help,
//       component: () => import(/* webpackChunkName: "about" */ '../components/promote/help/help')
//     },
//     {
//       path: '/index',
//       name: 'index',
//       component: () => import(/* webpackChunkName: "about" */ '../views/index/index.vue')
//     }
//
//
//
  ]
    }
)
router.$addRoutes = (params)=>{
  router.matcher = new VueRouter({
    mode:'history',base: process.env.BASE_URL,
  }).matcher
  router.addRoutes(params)
}

export default router




